\begin{lstlisting}[language=toolgrammar,mathescape]

MethodDeclaration ::=  def Identifier!\textbf{(}! (Identifier : Type (!\textbf{,}! Identifier : Type)$^*$)? !\textbf{)}! : Type  !\newline!    
      ThrowsClause? !\textbf{\{}! (VarDeclaration)$^*$ (Statement)$^*$  return Expression ; !\textbf{\}}!

ThrowsClause ::= throws Type (!\textbf{,}! Type)$^*$

Statement ::= ThrowClause
Statement ::= TryClause CatchClause$^+$ FinallyClause?
Statement ::= TryClause FinallyClause

ThrowClause ::= throw Expression;

TryClause ::=  try !\textbf{\{}! (Statement)$^+ $ !\textbf{\}}!
CatchClause ::= catch !\textbf{(}!Identifier : Type!\textbf{)}!  { (Statement)$^*$ } 
FinallyClause ::= finally { (Statement)$^+$ } 

\end{lstlisting}

Those new grammar rules allow methods to throw exceptions (using \emph{ThrowsClause}) upward and allows the programmer to throw his own exceptions at will.
Note that standalone \textsf{\small try}, empty \textsf{\small finally} and empty \textsf{\small try} are prohibited while empty \textsf{\small catch} are accepted.
See the chapter on design decisions for more details.
